package main.java.thread;

/**
 * 线程创建的方法：实现Thread接口
 */
public class ThreadDemo1 {
    //需求两个循环并发运行

    public static void main(String[] args) {
        Thread t1 = new MyThread1();
        Thread t2 = new MyThread2();
        t1.start();
        t2.start();
    }
}
class MyThread1 extends Thread{
    @Override
    public void run() {
        for (int i = 0; i < 1000; i++) {
            System.out.println("你是瓦学弟");
        }
    }
}
class MyThread2 extends Thread{
    @Override
    public void run() {
        for (int i = 0; i < 1000; i++) {
            System.out.println("那咋了");
        }
    }
}
